#include"bits/stdc++.h"
using namespace std;
int len,a,b,sw[8],h;
bool the_beginning_and_the_end_is_equal(int number)
{
	while(number)
	{
		len+=1;
		sw[len]=number%10;
		number/=10;
	}
	if(sw[1]==sw[len])
	{
		return true;
	}
	else
	{
		return false;
	}
}
int main()
{
	cin>>a>>b;
	for(int i=a;i<=b;i++)
	{
		if(the_beginning_and_the_end_is_equal(i))
		{
			h+=1;
		}
	}
	cout<<h;
}
